Morocco beat Ivory Coast 1-0 to reach the Africa Cup of Nations quarter-finals and knock out the champions.